namespace ghost
{
    export class ObjBase extends GameRole{
		// public _trail:TrailSprite;
		/**特效类型*/public effectType:EffectType;
		/**物体不飘字*/
		public numberLoop():void{}
		/**物体不做障碍阴影设置*/
		protected barrierStateCheck():void{}
		/**物体不带附件*/
		protected attachExitLoop(t:number):void{}
		/**物体初始化不继承GameRole的初始化数据*/
		protected init():void
		{
			this.skin.mouseThrough = true;
		}
        public setName(name:string,objID:string):void{}
		public setHpBar(objID: string, hideInterval:number=NaN):void{};
		public setCamp(camp:number):void
		{
			let s= this;
			// s._campObj = camp;
			s._camp = camp;
		}
		public setLayerType(layerType:number,pr:GYSprite=null,childIndex:number=0):void
		{
			let s = this;
			if(layerType == map2D.LayerType.ROLE_BACK)
			{				
				s._layerType = layerType;
				s._layer = s._owner.skin;
				s._layer.addChildAt(s._skin, childIndex);
			}				
			else if(layerType == map2D.LayerType.ROLE_FRONT)
			{				
				s._layerType = layerType;				
				s._layer = s._owner.skin;
				s._layer.addChild(s._skin);
			}
			else
				super.setLayerType(layerType,pr,childIndex);
		}
		public exitLoop(t: number, index: number): void 
		{
			let s = this;			
			//物体的exitLoop继承自AniRole
			AniRole.prototype.exitLoop.call(s, t, index);
		}
		public worldPosSet():void
		{
			let s= this;
			if(s.isSceneLayer())
			{				
                s._skin.x = s._absX - s._scene.mapX;
                s._skin.y = s._absY - s._absZ - s._scene.mapY - s._floatH;				
			}					
			else
			{				
				s._skin.x = s._owner._scaleDir == map2D.DirectionType.RIGHT?-s._absX:s._absX;
				s._skin.y = s._absY - s._absZ - s._floatH;								
			}			
		}       
		public setShadow(objID:string):void
		{
		}		
        public inArea():void
		{
			//物体不参与占地碰撞
		}
		/**标识离开某区域*/
		public outArea():void
		{
			//物体不参与占地碰撞
		}	         
		public setSts(sts:number=0,direction:number=-1):void
		{let s = this;			
			Role.prototype.setSts.call(s,sts,direction);
			direction = direction == -1?s._direction:direction;
			if(s._sts == sts && s._direction == direction)return;
			s._sts = sts;				
			s._direction = direction;			
			s.resetSkin(s._skinObj);//,false);
			// s._headH = s._clothes && s._clothes.headH?s._clothes.headH:0;
			if(StsType.isDeadSts(s._sts))
			{
				// if(s._cfg.deadSound)
				// 	SoundManager.instance.play(s._cfg.deadSound,0,1,null,null,SoundData.MULTI_CHANNEL);
				s._isDead = true;
				s.outArea();
			}	
		}		
		public beforeToPool():void
		{			
			super.beforeToPool();			
		}

		// protected destoryTrail():void
        // {
		// 	let s = this;
		// 	if(s._trail){
		// 		s._trail.dispose();
		// 		s._trail = null;
		// 	} 
		// }

		// protected showTrail(visible: boolean):void
        // {
		// 	let s = this;
		// 	if(s._trail){
		// 		s._trail.visible = visible;
		// 	} 
		// }
		
		// protected createTrail():void
        // {
        //     let s = this;
        //     if(s._trail == null)
        //     {
        //         s._trail = new TrailSprite;
        //         s._skin.addChildAt(s._trail, 0);
        //         s._trail.addTrail(s._skin, s.enabled3D);
		// 		s._trail.visible = true;
        //     }
        // }
    }
}